home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 004 / geosat.bas (.txt) < prev    next >
Encoding:
GW-BASIC  |  1984-04-24  |  16.2 KB  |  657 lines

  1. 10  FG=0:KEY OFF
  2. 20  GOTO 2700
  3. 25  '
  4. 30  '  ******
  5. 40  '
  6. 50  '  This module computes the look Azimuth and Elevation from a specified
  7. 51  '  position on the earth to a Synchronous Satellite.
  8. 60  '
  9. 70  '  ******
  10. 80  '
  11. 90  '  Azimuth is in Y
  12. 100  '  Elevation is in EL
  13. 110  '
  14. 120  '  First compute the proper Longitude Difference
  15. 130  '
  16. 140  T = M2 - M1
  17. 150  TA = ABS(T)
  18. 160  IF TA <= 180 THEN GOTO 190
  19. 170  TS = SGN(T)
  20. 180  T = -1 * ((TS * 360) - T)
  21. 190  EP = T
  22. 200  '
  23. 210  '  Now convert Angles into Radians
  24. 220  '
  25. 230  T = T / RD:L1 = L1 / RD:EP = EP / RD
  26. 240  '
  27. 250  '  Now compute MODIFIED receiver latitude
  28. 251  '
  29. 260  X = SQR (1 - 0.5 * (COS(L1) + COS(EP)))
  30. 270  ML = 2 * FN ARCSYN(X)
  31. 280  '
  32. 290  '  Now compute elevation look angle
  33. 300  '
  34. 310  EL = (PI / 2) - (ML + ATH(R * SIN(ML) / (R * (1 - COS(ML) * H))))
  35. 320  '
  36. 330  '  Now compute look azimuth
  37. 340  '
  38. 350  IF EP = 0 THEN YA = PI: GOTO 420
  39. 360  ZA = 1 / TAN(EP / 2)
  40. 370  ZB = TAN(L1 / 2)
  41. 380  YA = ATN(ZA * ZB) + ATN (ZA * (1 / ZB))
  42. 390  '
  43. 400  '  Now convert angles back to degrees
  44. 410  '
  45. 420  YA = YA * RD:EL = INT(EL * RD):L1 = L1 * RD
  46. 430  '
  47. 440  '  Correct look Azimuth for North/South Hemisphere
  48. 450  '
  49. 460  ZF = 360
  50. 470  IF L1 < 0 THEN GOTO 510
  51. 480  YA = 360 + YA
  52. 490  Y = FN MUD(YA)
  53. 500  RETURN
  54. 510  Y = INT(180 + YA)
  55. 520  RETURN
  56. 521  '
  57. 530  '  ******
  58. 540  '
  59. 550  '  Module to get city Name,Latitude and Longitude.
  60. 560  '
  61. 570  '  ******
  62. 571  '
  63. 580  SCREEN 0,0:CLS:LOCATE 3,1
  64. 590  INPUT "What is the name of the city ? ",NC$
  65. 600  LOCATE 7,1
  66. 610  INPUT "Enter the CITY Latitude using SPACES to seperate DEGREES, MINUTES,  and N(orth) or S(outh). ",DL$
  67. 620  '
  68. 630  '  Now decompose DL$ into degrees,minutes and N or S
  69. 640  '  Do degrees first
  70. 650  '
  71. 660  LE = LEN(DL$)
  72. 670  I = 1
  73. 680  IF MID$(DL$,I,1) = CHR$(32) THEN GOTO 800
  74. 690  IF (I = LE) THEN GOTO 750
  75. 700  I = I + 1:GOTO 680
  76. 710  '
  77. 720  '  Data is not in proper format
  78. 730  '  Send error message and do again
  79. 740  '
  80. 750  LOCATE 20,1:PRINT "When you enter the Latitude, be sure to use spaces to seperate the entries. ":LOCATE 24,27:INPUT"Press any key to continue!",KB$
  81. 760  LOCATE 7,1:CLS:GOTO 610
  82. 770  '
  83. 780  '  Get degrees
  84. 790  '
  85. 800  J = I - 1
  86. 810  DG = VAL(MID$(DL$,1,J))
  87. 820  '
  88. 830  '  Now look for minutes
  89. 840  '
  90. 850  MN = 0:KK = 0
  91. 860  I = I + 1
  92. 870  IF MID$(DL$,I,1) = CHR$(32) THEN GOTO 930
  93. 880  IF (I = LE) THEN GOTO 750
  94. 890  I = I + 1:KK = 1:GOTO 870
  95. 900  '
  96. 910  '  Get minutes
  97. 920  '
  98. 930  JK = I - 1
  99. 940  IF KK <> 0 THEN MN = VAL(MID$(DL$,J + 1,JK))
  100. 950  '
  101. 960  '  Degrees between 0-90 and minutes between 0-60?
  102. 970  '
  103. 980  IF NOT (DG > 90 OR DG < 0 OR MN > 60 OR MN < 0) THEN GOTO 1070
  104. 990  '
  105. 1000  '  Deg,min between correct limits
  106. 1010  '
  107. 1020  LOCATE 20,1:PRINT "Degrees are between 0 and 90 and Minutes are between 0 and 60.":INPUT "Any key to continue ";K$
  108. 1030  CLS:LOCATE 7,1:GOTO 610
  109. 1040  '
  110. 1050  '  Convert to decimal
  111. 1060  '
  112. 1070  L1 = DG + (MN / 60)
  113. 1080  '
  114. 1090  '  N or S?
  115. 1100  '
  116. 1110  I = I + 1
  117. 1120  NS$ = MID$(DL$,I,1)
  118. 1130  IF NS$ = "N" OR NS$ = "n" OR NS$ = "S" OR NS$ = "s" THEN GOTO 1220
  119. 1140  '
  120. 1150  '  Must be North or South
  121. 1160  '
  122. 1170  LOCATE 20,1:INPUT "Enter either N for North or S for South. Any key to continue. ";K$
  123. 1180  CLS:LOCATE 7,1:GOTO 610
  124. 1190  '
  125. 1200  '  Put in correct sigh for latitude
  126. 1210  '
  127. 1220  IF NS$ = "S" OR NS$ = "s" THEN L1 = -L1
  128. 1240  '
  129. 1250  '  Now get city longitude
  130. 1270  '
  131. 1280  LOCATE 11,1
  132. 1290  INPUT "Enter the city longitude  using SPACES to seperate DEGREES, MINUTES, and E(ast) or W(est). ",DL$
  133. 1300  '
  134. 1310  '  Now decompose Dl$ into degrees, minutes and E or W
  135. 1320  '  Do degrees first
  136. 1330  '
  137. 1340  LE = LEN(DL$)
  138. 1350  I = 1
  139. 1360  IF MID$(DL$,I,1) = CHR$(32) THEN GOTO 1480
  140. 1370  IF (I = LE) THEN GOTO 1430
  141. 1380  I = I + 1:GOTO 1360
  142. 1390  '
  143. 1400  '  Data is not in proper format
  144. 1410  '  Send error message and do again
  145. 1420  '
  146. 1430  LOCATE 20,1:PRINT"When you enter the longitude, be sure to use spaces to seperate the entries. ":LOCATE 24,27:INPUT"Press any key to continue!",KB$
  147. 1440  CLS;LOCATE 11,1:GOTO 1280
  148. 1450  '
  149. 1460  '  Get degrees
  150. 1470  '
  151. 1480  J = I - 1
  152. 1490  DG = VAL(MID$(DL$,1,J))
  153. 1500  '
  154. 1510  '  Now look for minutes
  155. 1520  '
  156. 1530  MN = 0:KK = 0
  157. 1540  I = I + 1
  158. 1550  IF MID$(DL$,I,1) = CHR$(32) THEN GOTO 1610
  159. 1560  IF (I = LE) THEN GOTO 1430
  160. 1570  I = I + 1:KK = 1:GOTO 1550
  161. 1580  '
  162. 1590  '  Get minutes
  163. 1600  '
  164. 1610  JK = I - 1
  165. 1620  IF KK <> 0 THEN MN = VAL(MID$(DL$,J + 1,JK))
  166. 1630  '
  167. 1640  '  Degrees between 0-180 and minutes between 0-60?
  168. 1650  '
  169. 1660  IF NOT (DG > 180 OR DG < 0 OR MN > 60 OR MN < 0) THEN GOTO 1750
  170. 1670  '
  171. 1680  '  Deg,min between correct limits
  172. 1690  '
  173. 1700  LOCATE 20,1:PRINT"Degrees are between 0 and 180 and Minutes are between 0 and 60.";:INPUT K$
  174. 1710  CLS:LOCATE 11,1:GOTO 1280
  175. 1720  '
  176. 1730  '  Convert to decimal
  177. 1740  '
  178. 1750  M1 = DG + (MN / 60)
  179. 1760  '
  180. 1770  '  E or W
  181. 1780  '
  182. 1790  I = I + 1
  183. 1800  EW$ = MID$(DL$,I,1)
  184. 1810  IF EW$ = "E" OR EW$ = "e" OR EW$ = "W" OR EW$ = "w" THEN GOTO 1900
  185. 1820  '
  186. 1830  '  Must be East or West
  187. 1840  '
  188. 1850  LOCATE 20,1:PRINT"Enter either E(ast) or W(est). ":INPUT"Any key to continue ";K$
  189. 1860  CLS:LOCATE 11,1:GOTO 1280
  190. 1870  '
  191. 1880  '  Put in correct sign for longitude
  192. 1890  '
  193. 1900  IF EW$ = "W" OR EW$ = "w" THEN M1 = -M1
  194. 1910  RETURN
  195. 1911  '
  196. 1920  '  ******
  197. 1930  '
  198. 1940  '  Module to get satellite name and longitude.
  199. 1950  '
  200. 1960  '  ******
  201. 1961  '
  202. 1970  CLS:LOCATE 3,1
  203. 1980  INPUT"What is the name of the satellite ? ",NS$
  204. 1990  LOCATE 5,1
  205. 2000  INPUT "Enter the Satellite longitude using SPACES to seperate DEGREES, MINUTES, and    E(ast) or W(est). ",SL$
  206. 2010  '
  207. 2020  '  Now decompose SL$ into degrees, minutes and E or W
  208. 2030  '  Do degrees first
  209. 2040  '
  210. 2050  LE = LEN(SL$)
  211. 2060  I = 1
  212. 2070  IF MID$(SL$,I,1) = CHR$(32) THEN GOTO 2190
  213. 2080  IF (I = LE) THEN GOTO 2140
  214. 2090  I = I + 1:GOTO 2070
  215. 2100  '
  216. 2110  '  Data is not in proper format
  217. 2120  '  Give error message and do again
  218. 2130  '
  219. 2140  LOCATE 20,1:PRINT"When you enter the longitude, be sure to use SPACES to seperate the entries. ":LOCATE 24,27:INPUT"Press Any key to continue!",KB$
  220. 2150  CLS:LOCATE 11,1:GOTO 1280
  221. 2160  '
  222. 2170  '  Get degrees
  223. 2180  '
  224. 2190  J = I - 1
  225. 2200  DG = VAL(MID$(SL$,1,J))
  226. 2210  '
  227. 2220  '  Now look for minutes
  228. 2230  '
  229. 2240  MN = 0:KK = 0
  230. 2250  I = I + 1
  231. 2260  IF MID$(SL$,I,1) = CHR$(32) THEN GOTO 2320
  232. 2270  IF (I = LE) THEN GOTO 2010
  233. 2280  I = I + 1:KK = 1:GOTO 2260
  234. 2290  '
  235. 2300  '  Get minutes
  236. 2310  '
  237. 2320  JK = I - 1
  238. 2330  IF KK <> 0 THEN MN = VAL(MID$(SL$,J + 1,JK))
  239. 2340  '
  240. 2350  '  Degrees between 0-180 and minutes between 0-60?
  241. 2360  '
  242. 2370  IF NOT (DG > 180 OR DG < 0 OR MN > 60 OR MN < 0) THEN GOTO 2460
  243. 2380  '
  244. 2390  '  Deg,min between correct limits
  245. 2400  '
  246. 2410  LOCATE 20,1:PRINT "Degrees are between 0 and 180 and minutes are between 0 and 60. ":INPUT "any key to continue ";K$
  247. 2420  CLS:LOCATE 5,1:GOTO 2000
  248. 2430  '
  249. 2440  '  Convert to decimal
  250. 2450  '
  251. 2460  M2 = DG + (MN / 60)
  252. 2470  '
  253. 2480  '  E or W
  254. 2490  '
  255. 2500  I = I + 1
  256. 2510  EW$ = MID$(SL$,I,1)
  257. 2520  IF EW$ = "E" OR EW$ = "e" OR EW$ = "W" OR EW$ = "w" THEN GOTO 2610
  258. 2530  '
  259. 2540  '  Must be east or west
  260. 2550  '
  261. 2560  LOCATE 20,1:PRINT "Enter either E(ast) or W(est). ":INPUT "Any key to continue ";K$
  262. 2570  CLS:LOCATE 11,1:GOTO 1280
  263. 2580  '
  264. 2590  '  Put in correct sign for longitude
  265. 2600  '
  266. 2610  IF EW$ = "W" OR EW$ = "w" THEN M2 = -M2
  267. 2620  RETURN
  268. 2621  '
  269. 2630  '  ******
  270. 2640  '
  271. 2650  '  Header module
  272. 2660  '
  273. 2670  '  ******
  274. 2671  '
  275. 2680  '  This module does the header and gives instructions as needed
  276. 2690  '
  277. 2700  COLOR 0,1:CLS
  278. 2710  LOCATE 10,20:COLOR 8,1 :PRINT"Geosynchronous Communications Satellite" :COLOR 0,1
  279. 2720  LOCATE 13,27:PRINT "Look Angle Calculator"
  280. 2730  FOR I = 1 TO 2000:NEXT I
  281. 2740  CLS:LOCATE 1,32:COLOR 8,1 :PRINT"G E O S A T" :COLOR 0,1
  282. 2750  LOCATE 8,1
  283. 2760  PRINT "This program will allow you to determine where you must  point your antenna to"
  284. 2770  PRINT "permit reception of signals transmitted from a Geosynchronous satellite."
  285. 2780  PRINT
  286. 2790  PRINT "If you need instructions on the operation of this program, press the <ESC> key,"
  287. 2800  PRINT "otherwise press the <RTN> key to start the program."
  288. 2840  LOCATE 23,4:PRINT"Press <ESC> to display the Instructions, or <RTN> to start the Program!";
  289. 2850  '
  290. 2860  '  What was entered?
  291. 2870  '
  292. 2880  KB$=INKEY$:IF KB$="" THEN 2880
  293. 2890  IF KB$=CHR$(27) THEN 2930 ELSE 6080
  294. 2900  '
  295. 2910  '  Give instructions
  296. 2920  '
  297. 2930  CLS:LOCATE 1,1:COLOR 8:PRINT TAB(34)"INSTRUCTIONS":COLOR 0:PRINT
  298. 2940  PRINT "    Whenever  there  are  parentheses around words or groups of letters in the "
  299. 2950  PRINT "instructions, this  means  that  the items inside the parentheses are optional."
  300. 2960  PRINT "Items inside the symbols < > are required operations or entries."
  301. 2970  PRINT
  302. 2980  PRINT TAB(28)"<SP>  is the space key."
  303. 2990  PRINT TAB(28)"<RTN> is the return key."
  304. 3000  PRINT TAB(28)"<ESC> is the escape key."
  305. 3010  PRINT : PRINT "    As a part of this program, there are 2 data sets.  One consists of a number"
  306. 3020  PRINT "of satellites and their longitudes.   The other is a number of cities and their"
  307. 3030  PRINT "latitudes and longitudes. For each data set, you will be asked whether you wish"
  308. 3040  PRINT "to use the information already in the program or wish to enter new information."
  309. 3050  PRINT "If you  choose to use the information  already in the program, simply enter the"
  310. 3060  PRINT "number that corresponds to the city or satellite you desire and press the <RTN>"
  311. 3070  PRINT "key."
  312. 3080  PRINT
  313. 3090  PRINT "   If you wish to enter your own city or satellite, press any key that does not"
  314. 3100  PRINT "correspond to a city or satellite and press <RTN>.  You will then be asked sev-"
  315. 3110  PRINT "eral questiones.  For NAMES OF SATELITES,  enter whatever you wish.  Use spaces"
  316. 3120  PRINT "and not commas as seperators if needed."
  317. 3130  PRINT:PRINT TAB(28)"Press <RTN> to continue!";
  318. 3140  KB$=INKEY$:IF KB$="" THEN 3140
  319. 3150  CLS:LOCATE 1,1:COLOR 8:PRINT TAB(34)"INSTRUCTIONS":COLOR 0:PRINT
  320. 3160  PRINT "    When LATITUDE information is requested, enter the data in the format:"
  321. 3170  PRINT :PRINT TAB(22)"DEGREES <SP> MINUTES <SP> N or S <RTN>"
  322. 3180  PRINT:PRINT "N(orth) or S(outh) must be enter,  but if you wish to skip the DEGREE or MINUTE"
  323. 3190  PRINT "entry just enter a space instead of the number.  Complete the entry by pressing"
  324. 3200  PRINT "<RTN>.  The same format is used for LONGITUDE data.  Just replace  N or S  with"
  325. 3210  PRINT "E(ast) or W(est)."
  326. 3211  PRINT:PRINT"   If the Elevation prints as `***', the satellite is below the horizon and is"
  327. 3212  PRINT "not in the `line of sight' of your installation."
  328. 3220  LOCATE 23,5:PRINT"Press <ESC> to re-display the Instructions, <RTN> to start the Program!";
  329. 3230  KB$=INKEY$:IF KB$="" THEN 3230
  330. 3240  IF KB$ <> CHR$(27) THEN 6000 ELSE 2930
  331. 3241  '
  332. 6000  '  ******
  333. 6010  '
  334. 6020  '  Initialization module
  335. 6030  '
  336. 6040  '  ******
  337. 6050  '
  338. 6060  '  Some constants
  339. 6070  '
  340. 6080  CLS:LOCATE 1,1:R=6378:H=35500:PI=3.14159
  341. 6090  RD=360/(2*PI)
  342. 6100  '
  343. 6110  '  Arcsin defination
  344. 6120  '
  345. 6130  DEF FN ARCSYN(X)=ATN(X/SQR(-X*X+1))
  346. 6140  '
  347. 6150  '  Modulus definition
  348. 6160  '
  349. 6170  DEF FN MUD(Z)=INT((Z/ZF-INT(Z/ZF))*ZF+0.05)*SGN(Z/ZF)
  350. 6180  '
  351. 6190  '  Read in the satellite parameters
  352. 6200  '
  353. 6210  RESTORE
  354. 6220  '
  355. 6230  '  N is the number or satellites in the lins
  356. 6240  '
  357. 6250  READ N
  358. 6260  '
  359. 6270  '  SN$( is name array and SN( is longitude array
  360. 6280  '
  361. 6290  IF FG=1 THEN GOTO 6340
  362. 6300  DIM SN$(N),SN(N),DS$(N),DS(N),P$(24),S%(2)
  363. 6310  '
  364. 6320  '  P$( is printer buffer
  365. 6330  '
  366. 6340  FOR I=1 TO N
  367. 6350  READ SN$(I)
  368. 6360  READ SN(I)
  369. 6370  NEXT I
  370. 6380  SN(0)=N
  371. 6390  '
  372. 6400  '  A( is look azimuth array and E( is look elevation array
  373. 6410  '
  374. 6420  IF FG=1 THEN GOTO 6470
  375. 6430  DIM A(N),E(N)
  376. 6440  '
  377. 6450  '  Read in city parameters, m is number of cities
  378. 6460  '
  379. 6470  READ M
  380. 6480  '
  381. 6490  '  Cn$( is city name array, CL( is city latitude array
  382. 6500  '  CM( is city longitude array
  383. 6510  '
  384. 6530  IF FG=1 THEN GOTO 6550
  385. 6540  DIM CN$(M),CL(M),CM(M)
  386. 6550  FOR I=1 TO M
  387. 6560  READ CN$(I)
  388. 6570  READ CL(I)
  389. 6580  READ CM(I)
  390. 6590  NEXT I
  391. 6600  CL(0)=M
  392. 6601  '
  393. 7000  '  ******
  394. 7010  '
  395. 7020  '  This module gives the city list along with the option of choosing one
  396. 7021  '  of the stored cities or entering a new one
  397. 7030  '
  398. 7040  '  ******
  399. 7041  '
  400. 7050  CLS:LOCATE 1,1
  401. 7060  PRINT "These cities are available:":LOCATE 5,1
  402. 7070  '
  403. 7080  '  Get number of cities. If >30 then truncate.
  404. 7090  '
  405. 7100  M=CL(0)
  406. 7110  IF M>30 THEN M=30
  407. 7120  '
  408. 7130  '  Determine number of rows of dual column printing needed
  409. 7140  '
  410. 7150  M1=M/2:M2=INT(M1):MP=M1-M2
  411. 7160  '
  412. 7170  '  Default tab offset positions
  413. 7180  '
  414. 7190  HL=11:HR=51
  415. 7200  FOR I=1 TO M2
  416. 7210  J=I+M2
  417. 7220  '
  418. 7230  '  If MP=0 there will be 2 columns on each row.  Otherwise there will be
  419. 7231  '  an extra row.
  420. 7240  '
  421. 7250  IF MP<>0 THEN J=J+1
  422. 7260  '
  423. 7270  '  Gosub determines the number of digits in I,J
  424. 7280  '
  425. 7290  GOSUB 30000
  426. 7300  PRINT TAB(HL-H1);I;TAB(HL+2);CN$(I);TAB(HR-H2);J;TAB(HR+2);CN$(J)
  427. 7310  NEXT I
  428. 7320  IF MP<>0 THEN GOSUB 30000:PRINT TAB(HL-H1);I;TAB(HL+2);CN$(I)
  429. 7330  '
  430. 7340  '  Get choice of city.  only one at a time!!!
  431. 7350  '
  432. 7360  LOCATE 21,1:PRINT "Enter your choice by indicating:":PRINT
  433. 7370  PRINT "      A number between 1 and";M;:INPUT ", or press any other key for a new city! ",KB$
  434. 7400  '
  435. 7410  '  What is KB$
  436. 7420  '
  437. 7430  CK=VAL(KB$)
  438. 7440  IF CK<1 OR CK>M THEN GOSUB 580:CK=M+1
  439. 7450  '
  440. 7460  '  Now do satellite
  441. 7470  '
  442. 8000  '  ******
  443. 8010  '
  444. 8020  '  This module gives the satellite list along with the option of using
  445. 8021  '  all the stored names or entering a new one
  446. 8030  '
  447. 8040  '  ******
  448. 8041  '
  449. 8050  CLS:LOCATE 2,1:PRINT "These satellites are available:":LOCATE 5,1
  450. 8070  '
  451. 8080  '  Get number of satellites.  If >30 then truncate
  452. 8090  '
  453. 8100  N=SN(0)
  454. 8110  IF N>30 THEN N=30
  455. 8120  '
  456. 8130  '  Determine number of dual column printings needed
  457. 8140  '
  458. 8150  N1=N/2:N2=INT(N1):NP=N1-N2
  459. 8160  '
  460. 8170  '  Default tab offset positions
  461. 8180  '
  462. 8190  HL=11:HR=51
  463. 8200  FOR I=1 TO N2
  464. 8210  J=I+N2
  465. 8220  '
  466. 8230  '  If NP=0 then there will be 2 columns for each row.  Otherwise, an
  467. 8231  '  extra row is needed
  468. 8240  '
  469. 8250  IF NP<> 0 THEN J=J+1
  470. 8260  '
  471. 8270  '  Gosub determines the number of digits in I,J
  472. 8280  '
  473. 8290  GOSUB 30000
  474. 8300  PRINT TAB(HL-H1);I;TAB(HL+2);SN$(I);TAB(HR-H2);J;TAB(HR+2);SN$(J)
  475. 8310  NEXT I
  476. 8320  IF NP<>0 THEN GOSUB 30000:PRINT (HL-H1);I;TAB(HL+2);SN$(I)
  477. 8330  '
  478. 8340  '  Now get choice of which satellite(s) to use
  479. 8350  '
  480. 8360  LOCATE 20,1:PRINT "Enter your choice by indicating:":PRINT
  481. 8370  PRINT "A number between 1 and";N;:INPUT ", Zero(0) for all, or any other key to enter the name of a new Satellite! ",KB$
  482. 8390  '
  483. 8400  '  What is KB$
  484. 8410  '
  485. 8420  SQ=ASC(KB$)
  486. 8430  SK=VAL(KB$)
  487. 8440  '
  488. 8450  '  Go get a new satellite?
  489. 8460  '
  490. 8470  IF SK=0 AND (SQ<48 OR SQ>57) THEN GOSUB 1970:SK=N+1
  491. 8471  '
  492. 9000  '  ******
  493. 9010  '
  494. 9020  '  Setup City, Satellite parameters prior to AZ,EL Calculation
  495. 9030  '
  496. 9040  '  ******
  497. 9050  '
  498. 9060  '  Do city first
  499. 9070  '
  500. 9080  IF CK>M THEN DC$=NC$
  501. 9090  IF CK<=M THEN DC$=CN$(CK):L1=CL(CK):M1=CM(CK)
  502. 9100  '
  503. 9110  '  Do satellite.  First setup default name array
  504. 9120  '
  505. 9130  N=SN(0)
  506. 9140  FOR I=0 TO N
  507. 9150  DS$(I)=SN$(I)
  508. 9160  DS(I)=SN(I)
  509. 9170  NEXT I
  510. 9180  '
  511. 9190  '  If sk=0 use all
  512. 9200  '
  513. 9210  IF SK=0 THEN GOTO 9350
  514. 9220  '
  515. 9230  '  Distinguish between sk=1,n and sk>n
  516. 9240  '
  517. 9250  DS(0)=1
  518. 9260  IF SK>N THEN GOTO 9300
  519. 9270  DS$(1)=DS$(SK)
  520. 9280  DS(1)=DS(SK)
  521. 9290  GOTO 9350
  522. 9300  DS$(1)=NS$
  523. 9310  DS(1)=M2
  524. 9320  '
  525. 9330  '  Now do AZ,EL Calculation
  526. 9340  '
  527. 9350  MX=DS(0)
  528. 9360  FOR I=1 TO MX
  529. 9370  M2=DS(I)
  530. 9380  GOSUB 140
  531. 9390  A(I)=Y:E(I)=EL
  532. 9400  NEXT I
  533. 9401  '
  534. 10000  '  ******
  535. 10010  '
  536. 10020  '  This module does the screen display of the calculations results
  537. 10030  '
  538. 10040  '  ******
  539. 10090  '
  540. 10140  '  Some defaults:  lines/page;start line;stop line;AZ,EL tabs
  541. 10150  '
  542. 10160  LP=15:ST=1:SP=LP:HL=50:HR=60
  543. 10170  '
  544. 10180  '  Determine number of display pages
  545. 10190  '
  546. 10200  Z1=INT(N/15)
  547. 10210  ZP=Z1+1
  548. 10220  '
  549. 10230  '  Display page loop
  550. 10240  '
  551. 10250  FOR ZQ=1 TO ZP
  552. 10260  GOSUB 11050
  553. 10270  LOCATE 8,1
  554. 10280  IF DS(0)<SP THEN SP=DS(0)
  555. 10290  FOR ZR=ST TO SP
  556. 10300  I=A(ZR):J=E(ZR)
  557. 10310  GOSUB 30000
  558. 10320  PRINT TAB(22);DS$(ZR);TAB(HL-H1);I;:IF J >-0 THEN PRINT TAB(HR-H2);J:GOTO 10330
  559. 10325  PRINT TAB(HR-2)"***"
  560. 10330  NEXT ZR
  561. 10340  LOCATE 24,19:INPUT"Enter <P> to print, or Press <RTN> to continue! ",KB$
  562. 10350  '
  563. 10360  '  If KB$= "P" then goto print routine
  564. 10370  '
  565. 10380  IF LEFT$(KB$,1) = "P" OR LEFT$(KB$,1) = "p" THEN GOSUB 50000
  566. 10390  ST=SP+1:SP=SP+LP:CLS
  567. 10400  NEXT ZQ
  568. 10410  '
  569. 10420  '  Do another set?
  570. 10430  '
  571. 10440  LOCATE 24,8
  572. 10460  PRINT "Press <RTN> to run the program again, or <ESC> to exit to Basic.";
  573. 10470  KB$ = INKEY$:IF KB$ = "" THEN 10470
  574. 10480  IF KB$=CHR$(13) THEN FG=1:GOTO 6080
  575. 10490  IF KB$=CHR$(27) THEN GOTO 10520
  576. 10500  GOTO 10440
  577. 10520  CLS:LOCATE 1,1:RUN"SDIR.BAS"
  578. 10530  END
  579. 10540  '
  580. 11000  '  ******
  581. 11010  '
  582. 11020  '  Header subroutine
  583. 11040  '
  584. 11041  '  ******
  585. 11042  '
  586. 11050  CLS:LOCATE 1,23:COLOR 8,1:PRINT "G E O - S A T E L L I T E   `Look  Angle'":COLOR 0,1
  587. 11060  LOCATE 3,10:PRINT "From: ";DC$
  588. 11070  LOCATE 5,51:PRINT "Antenna"
  589. 11080  PRINT TAB(24);"To";TAB(46);"Azimuth";TAB(55);"Elevation"
  590. 11090  RETURN
  591. 20000  '
  592. 20001  '  ******
  593. 20002  '
  594. 20010  '  Data statements
  595. 20020  '
  596. 20021  '  ******
  597. 20022  '
  598. 20030  DATA 12
  599. 20040  DATA Comstar 3,-87
  600. 20050  DATA Westar 3,-91
  601. 20060  DATA Comstar 2,-95
  602. 20070  DATA Westar 1,-99
  603. 20080  DATA Anik 1,-104
  604. 20090  DATA Anik 2,-109
  605. 20100  DATA Anik 3,-114
  606. 20110  DATA Satcom 2,-119
  607. 20120  DATA Westar 2,-123.5
  608. 20130  DATA Comstar 1,-128
  609. 20140  DATA Satcom 3,-132
  610. 20150  DATA Satcom 1,-135
  611. 20160  DATA 17
  612. 20170  DATA Washington D.C.,39,-77
  613. 20180  DATA Los Angeles Cal.,34,-118
  614. 20190  DATA New York NY.,40.75,-74
  615. 20200  DATA Atlanta Ga.,33.5,-84.5
  616. 20210  DATA Miami Fl.,25.75,-80.25
  617. 20220  DATA Jacksonville Fl.,30.5,-81.5
  618. 20230  DATA Tampa Fl.,28,-82.75
  619. 20240  DATA Anchorage Al.,60.8,-147
  620. 20250  DATA Nome Al.,65,-165
  621. 20260  DATA Phoenix Arz.,33.5,-112
  622. 20270  DATA Little Rock Ark.,34.75,-92.25
  623. 20280  DATA Portland Ore,45.5,-122.75
  624. 20290  DATA Seattle Wash.,47.5,-122.5
  625. 20300  DATA San Francisco Cal.,37.75,-122.5
  626. 20310  DATA Chicago Ill.,41.75,-87.75
  627. 20320  DATA Milwaukee Wisc.,43,-87.9
  628. 20330  DATA San Diego Cal.,32.65,-117.3
  629. 29970  '
  630. 29971  '  ******
  631. 29972  '
  632. 29980  '  Tab positioning Routine
  633. 29981  '
  634. 29982  '  ******
  635. 29990  '
  636. 30000  H1=3:H2=3
  637. 30010  IF I<100 THEN H1=2
  638. 30020  IF I<10 THEN H1=1
  639. 30030  IF J<100 THEN H2=2
  640. 30040  IF J<10 THEN H2=1
  641. 30050  RETURN
  642. 49950  '
  643. 49951  '  ******
  644. 49952  '
  645. 49960  '  Printer routine
  646. 49970  '
  647. 49971  '  ******
  648. 49972  '
  649. 49980  '  Follows screen format shown on page 30 of IBM Internal newsletter #2
  650. 49990  '
  651. 50000  S%(1) = &H5CD   'CD 05     INT 5
  652. 50010  S%(2) = &HCB     'RET
  653. 50020  SUBRT% = VARPTR(S%(1))
  654. 50030  CALL SUBRT%
  655. 50040  FOR L = 1 TO 7:LPRINT:NEXT L
  656. 50050  RETURN
  657.